package cn.yy.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Provider entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "provider", catalog = "phoneerp")
public class Provider implements java.io.Serializable {

	// Fields

	private Integer providerId;
	private Providetotalrbill providetotalrbill;
	private String proName;
	private String proTel;
	private String proAddress;
	private String isPayment;
	private Integer payBill;
	private String proContact;
	private String proContactTel;
	private Set<Inmatirial> inmatirials = new HashSet<Inmatirial>(0);
	private Set<Paybill> paybills = new HashSet<Paybill>(0);
	private Set<Providetotalrbill> providetotalrbills = new HashSet<Providetotalrbill>(
			0);
	private Set<Bonus> bonuses = new HashSet<Bonus>(0);

	// Constructors

	/** default constructor */
	public Provider() {
	}

	/** minimal constructor */
	public Provider(Providetotalrbill providetotalrbill, String proName,
			String proTel, String proAddress, String isPayment,
			Integer payBill, String proContact, String proContactTel) {
		this.providetotalrbill = providetotalrbill;
		this.proName = proName;
		this.proTel = proTel;
		this.proAddress = proAddress;
		this.isPayment = isPayment;
		this.payBill = payBill;
		this.proContact = proContact;
		this.proContactTel = proContactTel;
	}

	/** full constructor */
	public Provider(Providetotalrbill providetotalrbill, String proName,
			String proTel, String proAddress, String isPayment,
			Integer payBill, String proContact, String proContactTel,
			Set<Inmatirial> inmatirials, Set<Paybill> paybills,
			Set<Providetotalrbill> providetotalrbills, Set<Bonus> bonuses) {
		this.providetotalrbill = providetotalrbill;
		this.proName = proName;
		this.proTel = proTel;
		this.proAddress = proAddress;
		this.isPayment = isPayment;
		this.payBill = payBill;
		this.proContact = proContact;
		this.proContactTel = proContactTel;
		this.inmatirials = inmatirials;
		this.paybills = paybills;
		this.providetotalrbills = providetotalrbills;
		this.bonuses = bonuses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "providerId", unique = true, nullable = false)
	public Integer getProviderId() {
		return this.providerId;
	}

	public void setProviderId(Integer providerId) {
		this.providerId = providerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "providerTotalBillID", nullable = false)
	public Providetotalrbill getProvidetotalrbill() {
		return this.providetotalrbill;
	}

	public void setProvidetotalrbill(Providetotalrbill providetotalrbill) {
		this.providetotalrbill = providetotalrbill;
	}

	@Column(name = "proName", nullable = false, length = 15)
	public String getProName() {
		return this.proName;
	}

	public void setProName(String proName) {
		this.proName = proName;
	}

	@Column(name = "proTel", nullable = false, length = 29)
	public String getProTel() {
		return this.proTel;
	}

	public void setProTel(String proTel) {
		this.proTel = proTel;
	}

	@Column(name = "proAddress", nullable = false, length = 20)
	public String getProAddress() {
		return this.proAddress;
	}

	public void setProAddress(String proAddress) {
		this.proAddress = proAddress;
	}

	@Column(name = "isPayment", nullable = false, length = 10)
	public String getIsPayment() {
		return this.isPayment;
	}

	public void setIsPayment(String isPayment) {
		this.isPayment = isPayment;
	}

	@Column(name = "payBill", nullable = false)
	public Integer getPayBill() {
		return this.payBill;
	}

	public void setPayBill(Integer payBill) {
		this.payBill = payBill;
	}

	@Column(name = "proContact", nullable = false, length = 10)
	public String getProContact() {
		return this.proContact;
	}

	public void setProContact(String proContact) {
		this.proContact = proContact;
	}

	@Column(name = "proContactTel", nullable = false, length = 29)
	public String getProContactTel() {
		return this.proContactTel;
	}

	public void setProContactTel(String proContactTel) {
		this.proContactTel = proContactTel;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "provider")
	public Set<Inmatirial> getInmatirials() {
		return this.inmatirials;
	}

	public void setInmatirials(Set<Inmatirial> inmatirials) {
		this.inmatirials = inmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "provider")
	public Set<Paybill> getPaybills() {
		return this.paybills;
	}

	public void setPaybills(Set<Paybill> paybills) {
		this.paybills = paybills;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "provider")
	public Set<Providetotalrbill> getProvidetotalrbills() {
		return this.providetotalrbills;
	}

	public void setProvidetotalrbills(Set<Providetotalrbill> providetotalrbills) {
		this.providetotalrbills = providetotalrbills;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "provider")
	public Set<Bonus> getBonuses() {
		return this.bonuses;
	}

	public void setBonuses(Set<Bonus> bonuses) {
		this.bonuses = bonuses;
	}

}